#include "factoryImage.h"
#include <iostream>

SDL_Surface * FactoryImage::crear(string path) {
	SDL_Surface * surfaceTemporal = NULL;
	surfaceTemporal = SDL_LoadBMP(path.c_str());

	if (surfaceTemporal == NULL) {
		//TODO:Logear el error
		cout << SDL_GetError();
		return  NULL;
	}

	SDL_Surface * image = SDL_DisplayFormat(surfaceTemporal);
	SDL_FreeSurface(surfaceTemporal);

	return image;
}
